﻿@extends('home.layout')

@section('content')

    <div class="naver-main">
        <div class="layout">
            <!-- 20130909-导航-start -->
            <nav class="naver">
                <ul id="naver-list">
                    <li id="index">
                        <a class="current" href="{{ url('/home/index/index') }}">
                        <span>
                            首页
                        </span>
                        </a>
                    </li>
                    <li id="index">
                        <a class="current" href="{{ url('/home/plate/menuplate/1') }}">
                        <span>
                            新品上市专区
                        </span>
                        </a>
                    </li>
                    <li id="index">
                        <a class="current" href="{{ url('/home/plate/menuplate/2') }}">
                        <span>
                            降价特惠专区
                        </span>
                        </a>
                    </li>
                    <li id="index">
                        <a class="current" href="{{ url('/home/plate/menuplate/3') }}">
                        <span>
                            火爆销售专区
                        </span>
                        </a>
                    </li>
                </ul>
                <script>
                    $(function () {
                        $('#naver-list li').hover(function () {
                            $(this).addClass('hover');
                        }, function () {
                            $(this).removeClass('hover');
                        });

                    });
                </script>
            </nav>
            <!-- 20130909-导航-end -->
            <!-- 20140823-分类-start -->
            <div class="category category-index" id="category-block">
                <!-- 20140822-分类-start -->
                <div class="h">
                    <h2>
                        全部商品
                    </h2>
                    <i class="icon-category">
                    </i>
                </div>
                <div class="b">
                    <ol class="category-list">
                        <!-- 鼠标悬停增加ClassName： hover -->
                        @foreach($allPlates as $k => $v)
                            <li class="category-item ">
                            <div class="category-info" style="overflow: hidden;height:40px">
                                <h3>
                                    <a target="_blank">
                                    <span>
                                        {{ $v -> platename }}
                                    </span>
                                    </a>
                                </h3>
                                @foreach($sonPlates as $key => $val)
                                    @if($val -> pid == $v -> id)
                                <a href="{{ url('/home/plate/smallPlate/') }}/{{ $val->id }}">
                                <span>
                                    {{ $val -> platename }}
                                </span>
                                </a>
                                    @endif
                                @endforeach
                            </div>
                            <div class="category-panels children-col-1">
                                <ul class="subcate-list children-col-list">
                                    @foreach($sonPlates as $key => $val)
                                        @if($val -> pid == $v -> id)
                                    <li class="subcate-item">
                                        <a href="{{ url('/home/plate/smallPlate') }}/{{ $val->id }}">
                                        <span>
                                            {{ $val -> platename }}
                                        </span>
                                        </a>
                                    </li>
                                        @endif
                                    @endforeach
                                </ul>
                            </div>
                        </li>
                        @endforeach
                    </ol>
                </div>
            </div>
            <!-- 20140822-分类-end -->
            <!-- 20140823-分类-end -->
        </div>
    </div>
    <script>
        (function () {
            //所有分类显示隐藏控制
            var isIndex = true,
                categoryBlock = gid('category-block');

            if (isIndex) return;

            $("#category-block").hover(function () {
                $(this).addClass("category-hover");
            }, function () {
                $(this).removeClass("category-hover");
            });

            /*categoryBlock.onmouseover = function () {
             categoryBlock.className = 'category category-hover';
             };
             categoryBlock.onmouseout = function () {
             categoryBlock.className = 'category';
             };*/

        }());

        /**
         *功能：给鼠标移动到category-list li上面的时候，记得给他多添加一个hover类样式
         *目的是兼容ie6,以及调整二级分类的弹出框的位置。
         *@author 李峰
         */
        /**
         $(function(){
	$(".category-item").hover(function(){
		$(this).addClass("hover");
		//1.二级分类的top值
		var childrenTop = $(this).offset().top;
		//2.一级分类的top值
		var parentTop = $(".category-list").offset().top;
		//3.二级分类到一级分类顶部的距离
		var top = childrenTop - parentTop;
		//4.二级分类的弹出层的高度
		var childrenHeight = $(this).find(".category-panels").innerHeight();
		//5.一级分类容器的总高度
		var totalHeight = $(".category-list").height();
		alert("childrenTop:"+childrenTop+";parentTop:"+parentTop+";top:"+top+";childrenHeight:"+childrenHeight+";totalHeight:"+totalHeight) ;

		//6.如果二级分类.category-panels的内容高度大于总容量totalHeight,那么.category-panels置顶，然后多余的自动往下延续
		//如果二级分类childrenHeight内容高度(childrenHeight + top )大于totalHeight,那么.category-panels往上移动childrenHeight + top -totalHeight
		if((top + childrenHeight) > totalHeight)
		{
			if(childrenHeight > totalHeight)
			{
				$(this).find(".category-panels").css("top",-top);
			}else{
				//上移动
				var topX = (childrenHeight+top) - totalHeight;
				$(this).find(".category-panels").css("top",-topX);

			}

		}

	},function(){
		$(this).removeClass("hover");
	});
});
         */
    </script>
    <!-- 20130904-热门板-start -->

        <!--ads start-->

        <div style="width:1260px;height:448px;overflow: hidden; position: relative;margin:0 auto">
            <ul style="width:7680px;height: 448px;position: absolute;" id="lb">
                <li style="width:1920px;height:448px;float:left;">
                    <img src="{{ asset('/uploads/index/l1.jpg') }}" style="width:1920px;height:448px;margin-left: -300px;">
                </li>
                <li style="width:1920px;height:448px;float:left;">
                    <img src="{{ asset('/uploads/index/l2.jpg') }}"
                    style="width:1920px;height:448px;margin-left: -300px;">
                </li>
                <li style="width:1920px;height:448px;float:left;">
                    <img src="{{ asset('/uploads/index/l3.jpg') }}"
                    style="width:1920px;height:448px;margin-left: -300px;" >
                </li>
                <li style="width:1920px;height:448px;float:left;">
                    <img src="{{ asset('/uploads/index/l4.jpg') }}"
                    style="width:1920px;height:448px;margin-left: -300px;">
                </li>
            </ul>
            <div id='sid'>
                <span class='span'>1</span>
                <span class='span'>2</span>
                <span class='span'>3</span>
                <span class='span'>4</span>
            </div>
        </div>

        <!--ads end-->
<script type="text/javascript">
    var s = '-';
    var inte = null;
    run();
    function run() {
        inte = setInterval(function() {
            var left = $('#lb').position().left;
            if(left == -5760) {
                s = '+';
            }
            if(left == 0) {
                s = '-';
            }
            $('#lb').animate({
                left: s + '=1920px'
            }, 1000);
        }, 3000)
    }
    $('.span').mouseover(function() {
        var num = $(this).html() - 1;
        $('#lb').css('left', -num * 1920 + 'px');
        clearInterval(inte);
    }).mouseout(function() {
        run();
    });
</script>
    <!-- 20130904-热门板-end -->
    <div class="hr-20">
    </div>
    <!-- 20160812 首页轮播图下方  实名认证 热销推荐等 -->
    <div class="layout">
        <!--20160812 新增宫格菜单及广告 start-->
        <div class="channel-floor-0">
            <div class="h">
                <div class="span-240 fl">
                    <ul class="home-channel-list">
                        <li class="top left">
                            <a href="http://www.vmall.com/notice-657"
                               target="_blank">
                                <img alt="实名认证"
                                     src="{{ asset('/uploads/index/1.png') }}">
                                <span>
                                    实名认证
                                </span>
                                </img>
                            </a>
                        </li>
                        <li class="top">
                            <a href="http://www.vmall.com/recycle?url=%3Fpid%3D1032"
                               target="_blank">
                                <img alt="以旧换新"
                                     src="{{ asset('/uploads/index/2.png') }}/">
                                <span>
                                    以旧换新
                                </span>
                                </img>
                            </a>
                        </li>
                        <li class="top">
                            <a href="http://www.vmall.com/priority?ANONYMITY_LOGIN_NAME=lik***%40***&ANONYMITY_EMAIL=lik***%40***&ANONYMI"
                               onclick="_paq.push(['trackLink','PC首页功能导航_优购码', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"
                               target="_blank">
                                <img alt="优购码" src="{{ asset('/uploads/index/3.png') }}/">
                                <span>
                                    优购码
                                </span>
                                </img>
                            </a>
                        </li>
                        <li class="left">
                            <a href="http://www.vmall.com/honor/remind"
                               onclick="_paq.push(['trackLink','PC首页功能导航_开售提醒', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"
                               target="_blank">
                                <img alt="开售提醒" src="{{ asset('/uploads/index/4.png') }}/">
                                <span>
                                    开售提醒
                                </span>
                                </img>
                            </a>
                        </li>
                        <li class="">
                            <a href="http://www.vmall.com/notice-list"
                               onclick="_paq.push(['trackLink','PC首页功能导航_公告', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"
                               target="_blank">
                                <img alt="公告" src="{{ asset('/uploads/index/5.png') }}/">
                                <span>
                                    公告
                                </span>
                                </img>
                            </a>
                        </li>
                        <li class="">
                            <a href="http://www.vmall.com/privilege"
                               onclick="_paq.push(['trackLink','PC首页功能导航_特权频道', 'link', ' ']);ec.code.addAnalytics({hicloud:true});"
                               target="_blank">
                                <img alt="特权频道" src="{{ asset('/uploads/index/6.png') }}/">
                                <span>
                                    特权频道
                                </span>
                                </img>
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="span-960 fr">
                    <ul class="home-promo-list clearfix">
                        <li>
                            <a class="item" target="_blank">
                                <img src="{{ asset('/uploads/index/a.jpg') }}/">
                            </a>
                        </li>
                        <li>
                            <a class="item" target="_blank">
                                <img src="{{ asset('/uploads/index/b.jpg') }}/">
                            </a>
                        </li>
                        <li>
                            <a class="item"  target="_blank">
                                <img src="{{ asset('/uploads/index/c.jpg') }}/">
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
            <!--20160812 新增宫格菜单及广告 end-->
            <!--20160812 热销推荐 start-->
            <!-- 20160812-首页-热销推荐-start -->
            <div class="b">
                <div class="home-recommend-goods">
                    <div class="h">
                        <h2 class="title">
                            热销推荐
                        </h2>
                    </div>
                    <div class="b">
                        <div class="goods-box">
                            <ul class="grid-list" id="testBanner">
                                <!-- 取前5个 -->
                                @foreach($hotsale as $h)
                                    <li class="grid-items">
                                        <a class="thumb" href="{{ url('/home/goods/goodsDetail') }}/{{$h->id}}" target="_blank">
                                            <p class="grid-img">
                                                <img src="{{ asset('/uploads/goodspic/') }}/{{ $h->goodspic }}"/>
                                            </p>
                                            <h3 class="grid-title">
                                                {{ $h->goodsname }}
                                            </h3>
                                            <p class="grid-desc">
                                                销量{{ $h->sales }}
                                            </p>
                                            <p class="grid-price">
                                                &yen;{{ $h->price }}
                                            </p>
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 20160812-首页-热销推荐-end -->
            <!--20160812 热销推荐 end-->
            <div>
            </div>
        </div>
    </div>
    <!-- 20160812 首页轮播图下方 end -->
    <div class="hr-30">
    </div>
    <div class="layout">
        <!-- 20160802-banner-1200*110-start -->
        <div class="home-banner">
            <!-- 20160802-banner-图片轮换-start -->
            <div class="home-banner-slideshow">
                <!-- 20130903-ad-图片轮换-start -->
                <div class="banner-slideshow">
                    <div class="ec-slider" id="m-banner">
                        <ul class="ec-slider-list">
                            <li class="ec-slider-item">
                                <div class="ec-slider-item-img">
                                    <a
                                       onclick="_paq.push(['trackLink','首页中间通栏广告第1位', 'link', '']);ec.code.addAnalytics({hicloud:true});"
                                       target="_blank">
                                        <img src="{{ asset('/uploads/index/c2.png') }}"/>
                                    </a>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <script>
                        ec.load("ec.slider", {
                            loadType: "lazy",
                            callback: function () {
                                $("#m-banner").slider({
                                    width: 1200, //　必须
                                    height: 110, //　必须
                                    style: 1, //　1显示分页，2只显示左右箭头,3两者都显示
                                    pause: 5000, 	//间隔时间
                                    auto: true
                                });
                            }
                        });
                    </script>
                </div>
            </div>
            <!-- 20160802-banner-图片轮换-end -->
        </div>
        <!-- 20160802-banner-1200*110-end -->
    </div>
    <div class="hr-40">
    </div>
    <!-- 20160802-HOME GOOGLIST-start 商品详细信息展示-->
    <div class="home-channel-container">
        <div class="hr-10">
        </div>
        <!-- 初始值 -->
        @foreach($plates as $k => $v)
            <div class="layout">
                <div class="home-channel-floor">
                    <div class="h">
                        <h2 class="channel-title fl">
                            {{ $v->platename }}
                        </h2>
                        <ul class="channel-nav fl">
                            @foreach($sonPlates as $ky => $vl)
                                @if($vl -> pid == $v->id)
                                    <li>
                                        <a href="{{ url('/home/plate/smallPlate/') }}/{{ $vl -> id }}" target="_blank">
                                            {{ $vl -> platename }}
                                        </a>
                                    </li>
                                @endif
                            @endforeach
                        </ul>
                        <div class="channel-more fr">
                     <span>
                     </span>
                            <span>
                     </span>
                            <span>
                     </span>
                            <a href="/list-54" target="_blank">
                                更多
                            </a>
                            <span>
                     </span>
                            <span>
                     </span>
                            <span>
                     </span>
                        </div>
                    </div>
                    <div class="b">
                        <!--20160815 广告 start-->
                        <div class="span-232 fl">
                             <ul class="grid-promo-list">
                        <!--20160815 大广告 start-->
                        <li class="grid-items grid-items-lg">
                            <a class="thumb" target="_blank">
                                <img src="{{ asset('/uploads/index/lg.jpg') }}"/>
                            </a>
                        </li>
                    </ul>
                        </div>
                        <!--20160815 广告 end-->
                        <div class="span-968 fl">
                            <ul class="grid-list">
                                @foreach($goods as $ky => $vl)
                                    @if($vl -> path == $v -> id)
                                        <li class="grid-items">
                                            <a class="thumb" href="{{ url('/home/goods/goodsDetail/') }}/{{ $vl->id }}"
                                               target="_blank">
                                                <p class="grid-img">
                                                    <img alt="{{ $vl -> goodsname }}"
                                                         src="{{ asset('/uploads/goodspic/') }}/{{ $vl->goodspic }}">
                                                </p>
                                                <h3 class="grid-title">
                                                    {{ $vl -> goodsname }}
                                                </h3>
                                                <p class="grid-desc">
                                                    {{ $vl -> coupon }}
                                                </p>
                                                <p class="grid-price">
                                                    <em>
                                                        ¥
                                                    </em>
                                                    <span>
                                                        {{ $vl -> price }}
                                                    </span>
                                                </p>
                                            </a>
                                        </li>
                                    @endif
                                @endforeach
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        @endforeach
        <div class="hr-20">
        </div>
        <div class="layout">
            <div class="ec-slider-item-img">
                <!-- 20130903-ad-762*132-start -->
                <div class="ad fl">
                    <a target="_blank">
                        <img src="{{ asset('/uploads/index/c1.jpg') }}" style="float:none;"
                             title="实名认证"/>
                    </a>
                </div>
                <!-- 20130903-ad-762*132-end -->
            </div>
        </div>
        <div class="hr-20">
        </div>
    </div>
    <textarea class="hide" id="top-banner">
    <!-- 顶部banner -->
    <div class="top-banner-max hide" id="top-banner-max">
        <div class="top-banner-img">
            <a class="button-top-banner-min" href="javascript:;" id="top-banner-max-toggle" title="折叠">
                -
            </a>
        </div>
    </div>
    <div class="top-banner-min hide" id="top-banner-min">
        <div class="top-banner-img">
            <a class="button-top-banner-max hide" href="javascript:;" id="top-banner-min-toggle" title="展开">
                +
            </a>
            <a class="button-top-banner-close" href="javascript:;" id="top-banner-min-close"
               onclick="javascript:$('#top-banner-block').hide();" title="关闭">
                关闭
            </a>
        </div>
    </div>
        <!-- 顶部banner end -->
</textarea>
    <script>
        // 改为异步调用
        // document.write('<script src="js/servertime.js'+ new Date().getTime() +'"></' + 'script>');
    </script>
    <!-- 20160802-banner-hover效果 简易-end -->
    <script>
        (function () {
            $('.home-channel-container .grid-items').hover(function () {
                $(this).addClass('current')
            }, function () {
                $(this).removeClass('current')

            })
        })()
    </script>
    <script src="js/index.min.js">
    </script>
    <script>
        (function (_ec) {
//顶部banner
            _ec.bigAd = false;
            _ec.smallAd = false;
            _ec.bigadShowTime = 8000;
            _ec.now = new Date().format('yyyy-MM-dd HH:mm:ss');

            _ec.configNowTime = function () {
                if (_serverTime) {
                    _ec.now = new Date(_serverTime).format('yyyy-MM-dd HH:mm:ss');
                }
            }

            ec.load({
                url: "/serverTime.jsp?" + (new Date()).getTime(),
                type: "js",
                loadType: "lazy",
                onload: _ec.configNowTime
            });
        })(ec.index);
    </script>
@endsection

